#! /bin/sh -
#
# Multi-user mode with X11 session manager
#
# Copyright (c) 2018 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

umask 022
IFS='
 	'
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin

echo ""
echo "Looking for a graphical session manager ..."

type gdm && exec gdm -nodaemon
type kdm && exec kdm -nodaemon
type xdm && exec xdm -nodaemon

# Setback to INIT 3 in case of failure

echo ""
echo "If this message appears, it means that you do not have any"
echo "of the following combinations of session managers installed:"
echo "GDM, KDM, or XDM."
echo ""
exec telinit 3

